/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package SortingThreads;
import Sorting.Main;
import javax.media.j3d.BranchGroup;

/**
 *
 * @author rafael
 */
public class InsertionThread extends Thread {

    public InsertionThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        execute();
    }

    private void execute() {
        try {

            //Main.textPane.setPreferredSize(new Dimension(500, 300));
            Main.textPane.setText(Main.textoInsertion);
            BranchGroup bgroup = Main.addBranchGroup();
            Main.su.addBranchGraph(bgroup);

            Main.insertionSortFinal(Main.vetorNumeros);
            Main.sc.show(Main.frame);
            
        } finally {
            Main.isRunning = false;
            Main.clearTexts();
        }
    }
}
